import 'app_version.dart';

class BaseBean {
  int code;
  String msg;
  List<AppVersion>? data;

  BaseBean(this.code, this.msg, this.data);

  factory BaseBean.fromJson(Map<String, dynamic> json) {
    var data = parseVersionList(json["data"]);
    return BaseBean(int.parse(json["code"]), json["msg"], data);
  }

  static List<AppVersion>? parseVersionList(List<dynamic>? data) {
    if (data != null) {
      return data.map((e) => AppVersion.fromJson(e)).toList();
    }
    return null;
  }

  isSuccess() {
    return code == 20000;
  }
}
